import requests

from config import *


class OcrIdentifyAPI:
    def __init__(self):
        self.url_custPicIdentify = url_prefix + "/ocrIdentify/custPicIdentify"
        self.url_bankIdentify = url_prefix + "/ocrIdentify/bankIdentify"
        self.url_businessLicenseIdentify = url_prefix + "/ocrIdentify/businessLicenseIdentify"

    def custPicIdentify(self, data):
        r"""
        身份证单面OCR接口
        :param data: 请求参数
        :return: 返回结果
        """
        return requests.post(url=self.url_custPicIdentify, json=data)

    def bankIdentify(self, data):
        r"""
        银行卡OCR接口
        :param data: 请求参数
        :return: 返回结果
        """
        return requests.post(url=self.url_bankIdentify, json=data)

    def businessLicenseIdentify(self, data):
        r"""
        营业执照OCR接口
        :param data: 请求参数
        :return: 返回结果
        """
        return requests.post(url=self.url_businessLicenseIdentify, json=data)
